Skip to content

Use a better way of pinning the version of golangci-lint #4733

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 18, 2025

Conversation

stefanhaller
Copy link
Collaborator

@stefanhaller stefanhaller commented Jul 13, 2025

  • PR Description

Instead of requiring the user to install the right version of the tool in their .bin folder, create a shim that automatically runs the right version of the tool. This has several benefits:

  • it works out of the box with no setup required (the tool will be automatically downloaded and compiled the first time it is used)
  • no work needed for developers when we bump the golangci-lint version
  • it works in working copies that are used in different environments (e.g. locally on a Mac, or inside a dev container)

Approach suggested by @kyu08.

Replaces #4729.

@stefanhaller stefanhaller added the maintenance For refactorings, CI changes, tests, version bumping, etc label Jul 13, 2025
Copy link

codacy-production bot commented Jul 13, 2025

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
Report missing for d159b281
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (d159b28) Report Missing Report Missing Report Missing
Head commit (37d5aee) 56855 49330 86.76%

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#4733) 0 0 ∅ (not applicable)

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Footnotes

  1. Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.

@stefanhaller stefanhaller force-pushed the pin-version-of-golangci-lint branch 2 times, most recently from 22b2b9a to ad8c1b5 Compare July 13, 2025 15:57
stefanhaller and others added 2 commits July 18, 2025 15:33
Instead of requiring the user to install the right version of the tool in their
.bin folder, create a shim that automatically runs the right version of the
tool. This has several benefits:
- it works out of the box with no setup required (the tool will be automatically
  downloaded and compiled the first time it is used)
- no work needed for developers when we bump the golangci-lint version
- it works in working copies that are used in different environments (e.g.
  locally on a Mac, or inside a dev container)

Co-authored-by: kyu08 <49891479+kyu08@users.noreply.github.com>
@stefanhaller stefanhaller force-pushed the pin-version-of-golangci-lint branch from ad8c1b5 to c8a1e89 Compare July 18, 2025 13:33
@stefanhaller stefanhaller enabled auto-merge July 18, 2025 13:33
@kyu08
Copy link
Contributor

kyu08 commented Jul 18, 2025

@stefanhaller
I realized that we can delete RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.50.0 from Dockerfile now.

@stefanhaller stefanhaller disabled auto-merge July 18, 2025 13:34
@stefanhaller
Copy link
Collaborator Author

@kyu08 Thanks, you are right. 37d5aee

@kyu08
Copy link
Contributor

kyu08 commented Jul 18, 2025

@stefanhaller
Thanks for the fix!

@stefanhaller stefanhaller merged commit 143d476 into master Jul 18, 2025
13 checks passed
@stefanhaller stefanhaller deleted the pin-version-of-golangci-lint branch July 18, 2025 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance For refactorings, CI changes, tests, version bumping, etc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants